/***
 * @description axios封装
 * @file api.ts
 * @author andy
 * @date 2024/3/22 16:40
 */
// file:api.s
// 1、导入axios以及拦截器
import service from "./request";

// demo接口1
export const deleteUser = (id: any) => {
  return service({
    url: "/auth/index/deleteUser/" + id,
    method: "post",
  });
};

// 登录接口
export const login = (data: any) => {
  return service({
    url: "/auth/index/login",
    method: "post",
    data,
  });
};
// 商户列表
export const getUserlist = (data: any) => {
  return service({
    url: "/auth/index/getUserlist",
    method: "post",
    data,
  });
};

// 商户列表
export const updateByUserId = (data: any) => {
  return service({
    url: "/auth/index/updateByUserId",
    method: "post",
    data,
  });
};

// 批量删除
export const deleteUserAll = (data: any) => {
  return service({
    url: "/auth/index/deleteUserAll",
    method: "post",
    data,
  });
};
export const checkUser = (data: any) => {
  return service({
    url: "/auth/index/checkUser",
    method: "post",
    data,
  });
};
//添加品牌
export const addBrand = (data: any) => {
  return service({
    url: "/shop/index/addBrand",
    method: "post",
    data,
  });
};
//品牌分页列表
export const getBrandList = (data: any) => {
  return service({
    url: "/shop/index/getBrandList",
    method: "post",
    data,
  });
};
//品牌分页列表
export const checkBrandStatus = (data: any) => {
  return service({
    url: "/shop/index/checkBrandStatus",
    method: "post",
    data,
  });
};

//品牌分页列表
export const getTypeTree = () => {
  return service({
    url: "/shop/type",
    method: "get",
  });
};
// 登录接口
export const getMenuList = () => {
  return service({
    url: "/auth/index/getMenuList",
    method: "post",
  });
};

// 隐藏或者显示接口
export const setTypeStatus = (typeId: any, typeStatus: any) => {
  return service({
    url: "/shop/type/setTypeStatus/" + typeId + "/" + typeStatus,
    method: "post",
  });
};

//删除接口
export const delTypeById = (typeId: any) => {
  return service({
    url: "/shop/type/delTypeById/" + typeId,
    method: "post",
  });
};

//添加类型
export const addType = (data: any) => {
  return service({
    url: "/shop/type/addType",
    method: "post",
    data,
  });
};
//添加类型
export const updateType = (data: any) => {
  return service({
    url: "/shop/type/updateType",
    method: "post",
    data,
  });
};

//自定义分页列表
export const getProdList = (data: any) => {
  return service({
    url: "/shop/prod/getProdList",
    method: "post",
    data,
  });
};
//自定义分页列表
export const addProd = (data: any) => {
  return service({
    url: "/shop/prod/addProd",
    method: "post",
    data,
  });
};
//批量删除商品
export const deleteAll = (data: any) => {
  return service({
    url: "/shop/prod/deleteAll",
    method: "post",
    data,
  });
};

//下拉框树形查询
export const getSelectTypeList = () => {
  return service({
    url: "/shop/type/getSelectTypeList",
    method: "post",
  });
};

//下拉框品牌查询
export const getBrandListAll = () => {
  return service({
    url: "/shop/brand/getBrandListAll",
    method: "post",
  });
};
//下拉所有单位查询
export const getUnitListAll = () => {
  return service({
    url: "/shop/prod/getUnitListAll",
    method: "post",
  });
};
//下拉框查询搜有数据
export const getTagListAll = () => {
  return service({
    url: "/shop/prod/getTagListAll",
    method: "post",
  });
};
//下拉框查询搜有数据
export const getApprListAll = () => {
  return service({
    url: "/shop/prod/getApprListAll",
    method: "post",
  });
};

//添加商品附件
export const addProdAtta = (data: any) => {
  return service({
    url: "/shop/prod/addProdAtta",
    method: "post",
    data,
  });
};

//添加商品附件
export const getProdInfoList = (data: any) => {
  return service({
    url: "/shop/prodInfo/getProdInfoList",
    method: "post",
    data,
  });
};
export const addOrder = (data: any) => {
  return service({
    url: "/shop/order/addOrder",
    method: "post",
    data,
  });
};

//订单列表
export const getOrderList = (data: any) => {
  return service({
    url: "/shop/order/getOrderList",
    method: "post",
    data,
  });
};

//订单列表
export const delOrderAll = (data: any) => {
  return service({
    url: "/shop/order/delOrderAll",
    method: "post",
    data,
  });
};
//商品审核
export const checkProd = (data: any) => {
  return service({
    url: "/shop/prod/checkProd",
    method: "post",
    data,
  });
};
//商品分页列表从ES中获取
export const getProdListEs = (data: any) => {
  return service({
    url: "/shop/prod/getProdListEs",
    method: "post",
    data,
  });
};

//根据订单ID获取列表
export const getOrderRecordList = (orderId: any) => {
  return service({
    url: "/shop/orderRecord/getOrderRecordList/" + orderId,
    method: "post",
  });
};
